import java.io.IOException;
import java.net.MalformedURLException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class HttpJsoupTest {

	public static final String urlheader = "http://www.xaufe.edu.cn/Announcement/";

	public static void main(String args[]) throws MalformedURLException,
			IOException {

		String url = "http://www.xaufe.edu.cn/Components/GetPage.aspx?2";
		String resp = Http.get(url);
		Document doc = Jsoup.parse(resp);
		Elements ele = doc.getElementsByTag("td");

		for (Element e : ele) {
			/* @fixup there is a problem which has not been solved */
			// System.out.println(e);
			// System.out.println(
			// StringEscapeUtils.unescapeHtml(e.select("a[href]").first().attr("title")));
			// System.out.println(e.getElementsByAttributeValue("title",
			// "title"));
			// //System.out.println(e.getElementsByAttributeValue("",""));
			String title = ((e.getElementsByTag("a").first().attr("title")));
			String date = ((e.getElementsByTag("font").first().text()));
			String href = ((e.getElementsByTag("a").first().attr("href")));
			href = urlheader + href.substring(2,href.length()-2);
			System.out.println(title.substring(2,title.length()-2));
			System.out.println(href);
	        System.out.println(date);

		}

	}
}
